[pull] main from MetaMask:main#415
Merged
Merged
Conversation
## **Description** Removed pill style for a simple text style to align with design changes <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: style: update TokenDetails Contract Field styles ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2130 ## **Manual testing steps** ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="320" height="496" alt="image-20251209-201047" src="https://github.com/user-attachments/assets/10fec7c2-b4ac-45f0-93ec-5558899f5601" /> ### **After** <img width="566" height="191" alt="Screenshot 2025-12-16 at 10 59 11" src="https://github.com/user-attachments/assets/dd573c79-52dd-46a7-835c-50eca2981e06" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Simplifies the Token Details contract address from a pill to plain text with copy icon, migrates to Tailwind utilities and DS React Native Icon, and updates styles/snapshots. > > - **UI/Styling** > - Replace contract address "pill" with simple text + copy icon in `TokenDetailsList`. > - Use Tailwind utilities (`useTailwind`, `tw`) for spacing (`py-2`, `gap-1`). > - Switch to `@metamask/design-system-react-native` `Icon` and remove color props. > - **Styles Refactor** > - Simplify `styleSheet` in `TokenDetails.styles.tsx` (no theme param); remove unused `contentWrapper`, `icon`, `copyButton` styles. > - Adjust title padding to separate top/bottom in snapshots. > - **Tests** > - Update snapshots in `TokenDetailsList.test.tsx.snap`, `TokenDetails.test.tsx.snap`, and `AssetOverview.test.tsx.snap` to reflect new spacing, colors, and icon styling. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ed25af0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description**
TokenListController was not being initialized with its persisted state
on cold restart. This caused:
* 7 unnecessary API calls to fetch token lists for all chains on every
app cold start
* Redundant cache rewrites (~4MB) even though the data was already
persisted
## **Changelog**
CHANGELOG entry: Fix TokenListController initialization.
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/6dbd9427-0a6e-4b71-beea-72b10edad86f
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/8333ecc4-86f3-40f5-91bf-1cc0f008dd28
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Initialize `TokenListController` with persisted state during engine
startup.
>
> - **Engine controllers**:
> - Update `app/core/Engine/controllers/token-list-controller-init.ts`:
> - Extend `tokenListControllerInit` signature to accept
`persistedState`.
> - Pass `state: persistedState.TokenListController` to `new
TokenListController(...)`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3ba322f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…6 vCPUs, 48GB)" (#24071) Reverts #23869, which was found to be causing build failures. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Generates and uploads Android AABs in E2E builds, bumps the build runner to XL, and adjusts Gradle settings while cleaning up build flags. > > - **CI/Workflows** > - **`build-android-e2e.yml`**: > - Add AAB support: new outputs (`aab-uploaded`), paths (`aab-target-path`), cache entries, and artifact upload step. > - Bump runner to `24.04-xl`. > - Extend outputs to include AAB paths and upload outcome. > - **`run-e2e-workflow.yml`**: > - Propagate `aab-target-path` and create target dir for Android artifacts. > - **Build Script** (`scripts/build.sh`): > - Always generate AAB on Release builds (including E2E); remove Gradle debug flags. > - **Gradle Config** (`android/gradle.properties.github`): > - Increase heap to 16g, enable daemon, `configureondemand`, and set `workers.max=6`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cd23401. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** - Updated to use the BottomSheet component, and removed unused styles <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: refactor: update token detail options bottom sheet ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2131 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> <img width="280" height="602" alt="tradedetail-viewactionmenu-bs" src="https://github.com/user-attachments/assets/ee9755ac-846b-4d5f-a555-42780e9b158c" /> ### **After** <!-- [screenshots/recordings] --> <img width="961" height="1028" alt="Screenshot 2025-12-16 at 12 32 19" src="https://github.com/user-attachments/assets/bb748db7-397f-43d5-9cb3-0ec446b35e8c" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replaces the AssetOptions modal with the new BottomSheet and design-system Text/Icon, simplifying styles and adding an i18n header title. > > - **UI**: > - Replace `ReusableModal` with `BottomSheet`/`BottomSheetHeader` in `AssetOptions.tsx`; switch `dismissModal` calls to `onCloseBottomSheet`. > - Use `@metamask/design-system-react-native` `Text`/`Icon`; streamline option row rendering and layout. > - Simplify styles in `AssetOptions.styles.ts` (remove theme deps; set `padding: 12`, `gap: 16`). > - **Tests**: > - Update mocks (e.g., add `useSafeAreaFrame`) to support new bottom sheet rendering. > - **i18n**: > - Add `asset_details.options.title` (“Token options”) for the bottom sheet header. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f581706. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…23876) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** https://consensyssoftware.atlassian.net/browse/CARD-233 Region selector modal as well as additional issues in the onboarding flow <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Update region selector ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="1179" height="2556" alt="Simulator Screenshot - E2E Test - 2025-12-10 at 11 53 54" src="https://github.com/user-attachments/assets/f4133d9f-1075-4046-bfbc-994f2880659e" /> <img width="1179" height="2556" alt="Simulator Screenshot - E2E Test - 2025-12-10 at 11 53 33" src="https://github.com/user-attachments/assets/902167ad-c32f-4d4a-bde2-c26dcb919dd7" /> <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Introduce a region selector bottom sheet and migrate onboarding to Region objects, updating flows, routing, and validations across sign-up, phone, personal/physical/mailing address, plus consent handling and responsive styles. > > - **Onboarding UX**: > - **Region Selector Modal**: New `RegionSelectorModal` (with search, area code display, and selection callback) wired via `Routes.CARD.MODALS.REGION_SELECTION` and modal navigator. > - **Refactor Selects → Modal**: Replace dropdowns with modal selectors in `SignUp`, `SetPhoneNumber`, `PersonalDetails` (nationality), and `PhysicalAddress` (US state). > - **Region Model**: Switch `selectedCountry` from `string` to `Region` (`key`, `name`, `emoji`, `areaCode`); update validations and payloads (e.g., `countryOfResidence`, mapping, SSN/consent logic). > - **Routing**: Revise `OnboardingNavigator` initial route logic (UNVERIFIED→`SIGN_UP`, PENDING branching for phone/personal/address → `VERIFY_IDENTITY`, VERIFIED→`COMPLETE`) and fetch user on mount. > - **Consent & Tokens**: Harden consent creation/linking flow and store Baanx token using `mapCountryToLocation(selectedCountry?.key)`; add US-only electronic consent gating. > - **Buttons/UX**: Add `loading` to continue buttons; improve error resets on input change. > - **Redux**: > - Update `onboarding.selectedCountry` type to `Region`; add `resetAuthenticatedData`; keep selectors aligned. > - **Views/Styles**: > - `CardWelcome` styles made responsive via `useWindowDimensions`; `CardAuthentication` sign-up now deep-links to `ONBOARDING.SIGN_UP`. > - **i18n**: > - Add strings for region selector title and empty-state message. > - **Tests**: > - Extensive updates for new Region shape, modal behavior, routing changes, and consent handling across onboarding components. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e3d5941. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Bruno Nascimento <bruno.nascimento@consensys.net> Co-authored-by: Bruno Nascimento <brunonascimentodev@gmail.com>
…into ne… (#23831) …w one <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Adds a workflow and script to automatically merge all older release/X.Y.Z branches into a newly created release branch, favoring the destination on conflicts. **CI/CD:** New workflow /.github/workflows/merge-previous-releases.yml: Triggers via workflow_call or workflow_dispatch with new-release-branch input. Checks out repo and metamask/github-tools, configures git user, and runs merge script. New script /.github/scripts/merge-previous-releases.sh: Parses release/X.Y.Z branches, filters/sorts older versions, and merges them into NEW_RELEASE_BRANCH. Uses -X ours to resolve conflicts favoring destination; skips already merged branches; pushes only if merges occurred. Logs actions and summarizes merged vs skipped branches. Testing: consensys-test#59 1. Multiple branches, one already merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20072233678 2. Multiple branches, neither merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20073029520 3. Multiple branches, with merge conflicts: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20073136324 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: None ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a GitHub Actions workflow that, upon creating a `release/X.Y.Z` branch, validates the branch name and merges previous release branches into it using `metamask/github-tools`. > > - **CI/CD — GitHub Actions** > - **New workflow** `/.github/workflows/merge-previous-release-branches.yml`: > - Triggers on branch creation; validates `release/X.Y.Z` format. > - If valid, runs job to merge previous release branches into `${{ github.event.ref }}` using `metamask/github-tools/.github/actions/merge-previous-releases@v1.2.0` with `METAMASK_MOBILE_BRANCH_SYNC_TOKEN`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eb5031e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Ticket: https://consensyssoftware.atlassian.net/browse/INFRA-3188 Test stable sync branch: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20148777729/job/57923961348, consensys-test#174 > Adds a composite GitHub Action and script to auto-open PRs syncing `stable` into active `release/*` branches after a release is merged. > > - **CI/GitHub Actions** > - **New composite action** `/.github/actions/release-branch-sync/action.yml`: > - Inputs: `merged-release-branch`, `github-token`, optional `github-tools-repository` and `github-tools-ref`. > - Checks out repo and tools, configures git, runs sync script. > - **New script** `/.github/scripts/release-branch-sync.sh`: > - Detects active release branches via open PR titles matching `release: X.Y.Z`. > - Creates `stable-sync-release-X.Y.Z` branches from `origin/stable`, pushes, and opens PRs into corresponding `release/X.Y.Z` branches. > - Skips invalid/older-than-merged branches, the just-merged branch, non-existent branches, already up-to-date branches, or if a sync PR already exists. > - Emits a summary of created/skipped/failed operations. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: None ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a GitHub Actions workflow to validate merged release branch names and sync `stable` into open `release/*` branches. > > - **CI/GitHub Actions**: > - **New workflow** `/.github/workflows/release-branch-sync.yml` triggered on closed PRs to `stable`. > - **`validate-branch` job**: Ensures merged head branch matches `release/X.Y.Z`. > - **`sync-release-branches` job**: If valid, runs `metamask/github-tools/.github/actions/release-branch-sync@v1.2.0` to sync `stable` into open `release/*` branches using `STABLE_SYNC_TOKEN`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5492723. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> After Solana, add the support for Tron account Change. In parallel, a new PR is in progress to factorize this code and make it generic for all non-EVM chains: Solana, Tron, Bitcoin, etc. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Add Tron Account Change detection support for multichain Api (#23639) ## **Related issues** Fixes: ## **Manual testing steps** You could try with our Tron test app here: https://metamask.github.io/test-dapp-tron/latest/ ```gherkin Feature: User connection Scenario: User connection on Mainnet Given the network Shasta Network is selected by default When user user select mainnet network, and then select MetaMask Wallet Then MetaMask connection screen popup Scenario: User connection on Shasta (2 step connection) Given the network Shasta Network is selected by default When user user select MetaMask Wallet Then MetaMask connection screen popup to connect. Once connected an other connection screen to accept to connect to Shasta. Scenario: User reload the page Given the user is already connected to a specific network and account When user user reload the app Then the app should re-connect to Metamask automatically with the right account and network. Feature: Chain Change Scenario: Ask permission for new chain Given the network Shasta Network is the only one user accepted When user user switch to mainnet Then MetaMask connection screen popup to accept. Once connected the chain mainnet is selected. Scenario: Do not ask permission for chain Given the network Shasta Network AND mainnet are allowed When user user switch to mainnet Then the chain mainnet is selected. Feature: Account Change Scenario: User do not change if select a not allowed account Given the user allow only one account When user user switch to an other account Then nothing happens in the app. Scenario: User change if select an allowed account Given the user allow only 2 accounts When user user switch to the second account Then nothing the selected address change in the app Feature: Disconnect Scenario: User disconnects from MM Given the user is connected When user remove the session from MM Then the app disconnects ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds Tron accountChanged notifications to the Multichain provider, reusing a generalized notification helper, with new event subscriptions, tests, and dependency bumps. > > - **Core (`app/core/BackgroundBridge/BackgroundBridge.js`)** > - **Tron accountChanged support**: > - Add Tron-specific handlers: `handleTronAccountChangedFromScopeChanges`, `handleTronAccountChangedFromSelectedAccountChanges`, `handleTronAccountChangedFromSelectedAccountGroupChanges`, and `getTronAccountFromSelectedAccountGroup`. > - Track last selected Tron account via `lastSelectedTronAccountAddress` and emit initial `notifyTronAccountChangedForCurrentAccount()` on provider setup. > - Subscribe/unsubscribe to Tron-related Permission, Account, and AccountGroup events. > - **Generalization**: > - Replace ` > _notifySolanaAccountChange` with ` > _notifyMultichainAccountChange(scope, value)` and use for Solana and Tron. > - Rename helper to `getSolanaAccountFromSelectedAccountGroup()` and update Solana flows accordingly. > - **Tests (`app/core/BackgroundBridge/BackgroundBridge.test.js`)** > - Add comprehensive Tron tests for permissions, selected account changes, and account group changes. > - Minor Solana test assertion fix and alignment with generalized notifier. > - **Dependencies (`package.json`, `yarn.lock`)** > - Bump `@metamask/chain-agnostic-permission` to `^1.3.0`. > - Bump `@metamask/multichain-api-client` to `^0.10.1` and `@metamask/multichain-api-middleware` to `1.2.5`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3d95aa3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Baptiste Marchand <75846779+baptiste-marchand@users.noreply.github.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Add `destToken` param to `useSwapBridgeNavigation` with similar structure as `sourceToken`. Extend the functionality to use the user-provided `destToken` if exist else default back to default/native selection. `destToken` should be a valid object as no quotes will be fetched. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3568 ## **Manual testing steps** ```gherkin The updated API is currently not used by anyone and is introduced to unblock work from other teams, thus there is not a way to test this on production app appart from ensuring that no regressions were introduced. To do that, please select various tokens from dashboards and navigate to swaps through asset screen, then verify upon entering a valid amount that quotes are fecthed. ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds optional destToken input and override handling to the swap/bridge navigation hook with default/native fallbacks and comprehensive tests (including Solana). > > - **Hook `useSwapBridgeNavigation`**: > - Accepts new optional `destToken` param; `goToSwaps` now supports `(tokenOverride?, destTokenOverride?)` and forwards both to `goToNativeBridge`. > - Adds destination token selection logic: prefer provided `destToken` when different from `sourceToken`; else compute via `getDefaultDestToken`; else fall back to `getNativeSourceToken`, ensuring source/dest differ. > - Refactors internals: `tokenBase` -> `sourceTokenBase`; `getEffectiveSourceChainId` naming; preserves CAIP chain IDs for non-EVM. > - **Navigation/State**: > - Dispatches `setDestToken` based on new logic; continues to reset `isDestTokenManuallySet` and set `sourceToken` before navigating. > - **Tests**: > - Adds extensive tests for dest token handling, overrides, fallbacks, and non-dispatch when identical. > - Covers Solana CAIP chain ID behavior and dest token dispatch. > - Mocks `getDefaultDestToken` and `getNativeSourceToken` in tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3132ffb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description**
The "Minimum Received" amount in the bridge feature was rounding up when
displaying values with decimal precision, which could show users a
minimum amount higher than they might actually receive (e.g., 0.01257
displayed as 0.013).
This change ensures the minimum received amount always rounds down by
flooring the value before formatting, so users never see a minimum that
exceeds what they'll actually receive.
## **Changelog**
CHANGELOG entry: improved the minimum received bridge label by rounding
down
## **Related issues**
Fixes: [add your ticket link here]
## **Manual testing steps**
Feature: Bridge Minimum Received Display
Scenario: user views minimum received amount in bridge quote
Given user is on the bridge screen with a valid quote
And the estimated destination amount has decimal precision (e.g.,
0.01257)
When user views the quote details
Then the "Minimum received" amount should be rounded down
And the displayed minimum should never exceed the estimated amount
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds a formatter that floors minimum received to 8 decimals and uses
it in QuoteDetailsCard, with unit tests.
>
> - **Bridge Utils**:
> - Add `formatMinimumReceived` in `utils/currencyUtils` to floor values
to 8 decimals and format via locale.
> - Add tests in `utils/currencyUtils.test.ts` covering flooring
behavior, string parsing, invalid input, and locale usage.
> - **UI**:
> - Update `components/QuoteDetailsCard/QuoteDetailsCard.tsx` to use
`formatMinimumReceived` for displaying `minimum_received`, replacing
direct intl formatting.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f7abb27. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: chore: Refine Custom Network button and avatar styles ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/MDP/boards/2972?search=custom&selectedIssue=MDP-242 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** ### **After** <img width="793" height="786" alt="Screenshot 2025-12-03 at 1 02 59 PM" src="https://github.com/user-attachments/assets/f4f95bf3-eb9d-427b-9d6f-d448a383f415" /> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Centers cell row content, updates Custom Network selector styling (button design, themed styles), and increases network avatar size; adjusts tests and snapshots accordingly. > > - **UI**: > - **Cells**: Center-align row content by adding `alignItems: 'center'` in `components-temp/CellSelectWithMenu/CellSelectWithMenu.styles.ts`. > - **Custom Network Selector**: > - Refactor `CustomNetworkSelector.styles.ts` to accept themed params and update styles (rounded/padded `addNetworkButtonContainer`, new `iconContainer` with muted background, 32x32, centered). > - Update footer button: wrap `Add` icon in `iconContainer`, switch icon/text to primary color, text variant to `BodyMDMedium`. > - Increase avatar size in list items to `AvatarSize.Md`. > - **Tests/Snapshots**: > - Update `useStyles` call expectation to use `createStyles` with `{}`. > - Refresh snapshots to reflect centered rows and updated layouts. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 605ea14. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
…ome screen (#24062) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** After profiling the app I encountered quite a big performance and UX issue when switching between home screen and trending screen: - As you can see whenever we navigate to any screen and go back to the main screen, the state and UI is kept and not re-rendered - But when we navigate to trending and going back to the main screen the whole UI is re-rendered <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: avoid re-rendering home when navigating back from trending ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2153 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/e2eac97d-da55-454d-a283-bf445a837cd1 <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/5175b72c-6c1e-4da1-be96-634443a88bd9 <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Change trending tab to call `navigation.navigate` to `Routes.TRENDING_VIEW` (when enabled) instead of `navigation.reset`, with tests updated accordingly. > > - **Navigation** > - `TabBar`: For `Routes.TRENDING_VIEW`, replace `navigation.reset(...)` with `navigation.navigate(Routes.TRENDING_VIEW)` when the `assetsTrendingTokens` feature flag is enabled. > - **Tests** > - Update `app/component-library/components/Navigation/TabBar/TabBar.test.tsx` to expect `navigation.navigate(Routes.TRENDING_VIEW)` and not `reset`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5140c8c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )